<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageContent">
	<form method="post" action="${pageContext.request.contextPath}${requestScope.record ==null ?'/investment/investment/insert' :'/investment/investment/update' }" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
		<div class="pageFormContent" layoutH="56">
			<!-- 关闭窗口 -->
			<input type="hidden" name="callbackType" value="closeCurrent" />
			<!-- 隐藏表单 -->
			<c:if test="${requestScope.record !=null}">
				<input type="hidden" name="id" value="${requestScope.record.id}" />
			</c:if>
			<p>
				<label>跟进人</label> 
				<select name="maid" class="combox">
					<option value="">请选择</option>
					<c:forEach items="${requestScope.mEmployees}" var="EmployeesItem">
						<option value="${EmployeesItem.employeeId}" ${EmployeesItem.employeeId == requestScope.record.maid?'selected':''}>${EmployeesItem.employeeName}</option>
					</c:forEach>
				</select>
			</p>
			<p>
				<label>姓名</label> <input name="name" class="required" maxlength="20" type="text" value="${requestScope.record.name}" />
			</p>
			<p>
				<label>性别</label> 
				<input name="sex" class="required" maxlength="11" type="radio" value="1" checked="checked" />男
				<input name="sex" class="required" maxlength="11" type="radio" value="0" />女
			</p>
			<p>
				<label>电话</label> <input name="phone" class="required" maxlength="11" minlength="11" type="text" value="${requestScope.record.phone}" />
			</p>
			<p class="nowrap" style="width: 585px;">
				<label>地址（省&市/区）</label> <input type="hidden" name="areaName" value="${requestScope.record.areaName}" /> <select class="combox required" name="areaCode" id="investment_combox_province" ref="investment_combox_city" refUrl="${pageContext.request.contextPath}/system/areas/getCityByProvince?id={value}" default-value="110000">
					<c:if test="${requestScope.province==null}">
						<option value="all">请选择省份</option>
					</c:if>
					<c:forEach items="${requestScope.provinces}" var="item">
						<option value="${item.id}" ${item.id==requestScope.province?"selected":""}>${item.name}</option>
					</c:forEach>
				</select> <select class="combox required" name="areaCode" id="investment_combox_city" ref="investment_combox_region" refUrl="${pageContext.request.contextPath}/system/areas/getCountyByAreas?id={value}" default-value="110100">
					<c:if test="${requestScope.city==null}">
						<option value="all">请选择城市</option>
					</c:if>
					<c:forEach items="${requestScope.citys}" var="item">
						<option value="${item.id}" ${item.id==requestScope.city?"selected":""}>${item.name}</option>
					</c:forEach>
				</select> <select class="combox required" name="areaCode" id="investment_combox_region" default-value="110100">
					<c:if test="${requestScope.county==null}">
						<option value="all">请选择市区</option>
					</c:if>
					<c:forEach items="${requestScope.countys}" var="item">
						<option value="${item.id}" ${item.id==requestScope.county?"selected":""}>${item.name}</option>
					</c:forEach>
				</select>
			</p>
			<p>
				<label>招商类型</label> <%-- <input name="type" class="required" maxlength="50" type="text" value="${requestScope.record.type}"  /> --%>
				<select name="type" class="combox">
					<option value="">请选择</option>
					<c:forEach items="${requestScope.itmtTypes}" var="item">
						<option value="${item.id }" ${requestScope.record.type == item.id?'selected':''}>${item.val }</option>
					</c:forEach>
				</select>
			</p>
			<p>
				<label>状态</label> 
				<select name="state" class="combox">
					<option value="">请选择</option>
					<option value="1" ${requestScope.record.state == 1?'selected':''}>未联系</option>
					<option value="2" ${requestScope.record.state == 2?'selected':''}>沟通跟进中</option>
					<option value="3" ${requestScope.record.state == 3?'selected':''}>无效</option>
					<option value="4" ${requestScope.record.state == 4?'selected':''}>已成交</option>
				</select>
			</p>
			<p>
				<label>客户意向</label> <input name="intent" class="required" maxlength="200" type="text" value="${requestScope.record.intent}" />
			</p>
			<p class="nowrap">
				<label>备注1</label> 
				<textarea rows="4" cols="25" name="remk1" maxlength="200" >${requestScope.record.remk1}</textarea>
			</p>
			<p class="nowrap">
				<label>备注2</label> 
				<textarea rows="4" cols="25" name="remk2" maxlength="200" >${requestScope.record.remk2}</textarea>
			</p>
			<p class="nowrap">
				<label>备注3</label> 
				<textarea rows="4" cols="25" name="remk3" maxlength="200" >${requestScope.record.remk3}</textarea>
			</p>
			<p class="nowrap">
				<label>备注4</label> 
				<textarea rows="4" cols="25" name="remk4" maxlength="200" >${requestScope.record.remk4}</textarea>
			</p>
			<p class="nowrap">
				<label>备注5</label> 
				<textarea rows="4" cols="25" name="remk5" maxlength="200" >${requestScope.record.remk5}</textarea>
			</p>
		</div>
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div></li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
	</form>
</div>
<script type="text/javascript">
	$(".combox").change(function() {
		$("ul,li,a").find("[value='all']").remove();
		var province = $("#investment_combox_province").find("option:selected").text();
		var city = $("#investment_combox_city").find("option:selected").text();
		var region = $("#investment_combox_region").find("option:selected").text();
		$("[name='areaName']").val(province + "," + city + "," + region);
	});
</script>